//
//  UIView+GGLayout.m
//  Mob
//
//  Created by engfei on 2017/3/15.
//  Copyright © 2017年 GaiGai. All rights reserved.
//

#import "UIView+GGLayout.h"

@implementation UIView (GGLayout)

- (void)setGg_x:(CGFloat)gg_x{
    CGRect frame = self.frame;
    frame.origin.x = gg_x;
    self.frame = frame;
}

- (CGFloat)gg_x{
    return self.frame.origin.x;
}

- (void)setGg_y:(CGFloat)gg_y{
    CGRect frame = self.frame;
    frame.origin.y = gg_y;
    self.frame = frame;
}

- (CGFloat)gg_y{
    return self.frame.origin.y;
}

- (void)setGg_width:(CGFloat)gg_width{
    CGRect frame = self.frame;
    frame.size.width = gg_width;
    self.frame = frame;
}

- (CGFloat)gg_width{
    return self.frame.size.width;
}

- (void)setGg_height:(CGFloat)gg_height{
    CGRect frame = self.frame;
    frame.size.height = gg_height;
    self.frame = frame;
}

- (CGFloat)gg_height{
    return self.frame.size.height;
}

- (void)setGg_size:(CGSize)gg_size{
    CGRect frame = self.frame;
    frame.size = gg_size;
    self.frame = frame;
}

- (CGSize)gg_size{
    return self.frame.size;
}

- (void)setGg_origin:(CGPoint)gg_origin{
    CGRect frame = self.frame;
    frame.origin = gg_origin;
    self.frame = frame;
}

- (CGPoint)gg_origin{
    return self.frame.origin;
}

- (void)setGg_centerx:(CGFloat)gg_centerx{
    CGPoint point = self.center;
    point.x = gg_centerx;
    self.center = point;
}

- (CGFloat)gg_centerx{
    return self.center.x;
}

- (void)setGg_centery:(CGFloat)gg_centery{
    CGPoint point = self.center;
    point.y = gg_centery;
    self.center = point;
}

- (CGFloat)gg_centery{
    return self.center.y;
}

- (void)setGg_bottom:(CGFloat)gg_bottom{
    CGRect frame = self.frame;
    frame.origin.y = gg_bottom - frame.size.height;
    self.frame = frame;
}

- (CGFloat)gg_bottom{
    return CGRectGetMaxY(self.frame);
}

- (void)setGg_top:(CGFloat)gg_top{
    CGRect frame = self.frame;
    frame.origin.y = gg_top;
    self.frame = frame;
}

- (CGFloat)gg_top{
    return self.frame.origin.y;
}

- (void)setGg_right:(CGFloat)gg_right{
    CGRect frame = self.frame;
    frame.origin.x = frame.origin.x - frame.size.width;
    self.frame = frame;
}

- (CGFloat)gg_right{
    return CGRectGetMaxX(self.frame);
}

- (void)setGg_left:(CGFloat)gg_left{
    CGRect frame = self.frame;
    frame.origin.x = gg_left;
    self.frame = frame;
}

- (CGFloat)gg_left{
    return self.frame.origin.x;
}




@end
